<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <!--<link rel="stylesheet" type="text/css" href="/plugins/css/city-picker.css">-->
    <title>修改赛事信息</title>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin layui-bg-blue">
    <!-- 头部区域 -->
    <div th:replace="index::topbar"></div>

    <!-- 左侧导航区域 -->
    <div th:replace="index::sidebar"></div>

    <!-- 底部固定区域 -->
    <div th:replace="index::bottombar"></div>

    <!-- 内容主体区域 -->
    <div class="layui-body">
        <form class="layui-form" th:action="@{/modifyLeague(league_id=${league.league_id})}" th:object="${league}"
              method="post">
            <br>
            <input type="hidden" name="league_id" th:value="*{league_id}"/>
            <!--赛事全程-->
            <div class="layui-form-item">
                <label class="layui-form-label">*赛事全称</label>
                <div class="layui-input-inline">
                    <input th:value="*{leagueName}" type="text" id="leagueName" name="leagueName" required
                           lay-verify="required" placeholder="请输入联赛全称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!--赛事简称-->
            <div class="layui-form-item">
                <label class="layui-form-label">赛事简称</label>
                <div class="layui-input-inline">
                    <input th:value="*{shorterName}" type="text" id="shorterName" name="shorterName" required
                           lay-verify="required" placeholder="请输入联赛简称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!--开始时间-->
            <div class="layui-form-item">
                <label class="layui-form-label">*开始时间</label>
                <div class="layui-inline">
                    <input th:value="*{startDate}" type="text" name="startDate" class="layui-input" id="StartTime"
                           placeholder="请选择开始时间">
                </div>
            </div>
            <!--结束时间-->
            <div class="layui-form-item">
                <label class="layui-form-label">*结束时间</label>
                <div class="layui-inline">
                    <input th:value="*{endDate}" type="text" name="endDate" class="layui-input" id="EndTime"
                           placeholder="请选择结束时间">
                </div>
            </div>
            <!--主办方-->
            <div class="layui-form-item">
                <label class="layui-form-label">主办方</label>
                <div class="layui-input-inline">
                    <input th:value="*{sponsor}" type="text" name="sponsor" placeholder="请输入赛事主办方" class="layui-input"
                           autocomplete="">
                </div>
            </div>
            <!--赛制章程-->
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">赛制章程</label>
                <div class="layui-input-block">
                    <textarea th:text="*{constitution}" type="text" name="constitution" id="constitution"
                              placeholder="请输入赛制章程" class="layui-textarea" style="width:50%">"</textarea>
                </div>
            </div>
            <!--赛事性质-->
            <div class="layui-form-item">
                <label class="layui-form-label">赛事性质</label>
                <div class="layui-input-block" style="width:20%">
                    <select th:field="${league.level}" th:value="${league.level}" name="level" lay-verify="required">
                        <!--<option th:value="*{level}" th:text="*{level}"></option>-->
                        <option value="">请选择赛事性质</option>
                        <option th:selected="${league.level=='职业联赛'}" value="职业联赛">职业联赛</option>
                        <option th:selected="${league.level=='社会/企业'}" value="社会/企业">社会/企业</option>
                        <option th:selected="${league.level=='大学'}" value="大学">大学</option>
                        <option th:selected="${league.level=='高中'}" value="高中">高中</option>
                        <option th:selected="${league.level=='初中'}" value="初中">初中</option>
                        <option th:selected="${league.level=='小学'}" value="小学">小学</option>
                        <option th:selected="${league.level=='幼儿园'}" value="幼儿园">幼儿园</option>
                    </select>

                    <!--下拉框回显方案一-->
                    <!--<select th:field="${league.level}" th:switch="${league.level}" name="level">
                        <option value="">请选择赛事性质</option>
                        <option th:case="'社会/企业'" th:selected="selected" value="社会/企业">社会/企业</option>
                        <option th:case="'大学'" th:selected="selected" value="大学">大学</option>
                        <option th:case="'高中'" th:selected="selected" value="高中">高中</option>
                        <option th:case="'初中'" th:selected="selected" value="初中">初中</option>
                        <option th:case="'小学'" th:selected="selected" value="小学">小学</option>
                        <option th:case="'幼儿园'" th:selected="selected" value="幼儿园">幼儿园</option>
                    </select>-->
                    <!--下拉框回显方案二-->
                    <!--<select th:field="${league.level}" name="level">
                        <option value="">请选择赛事性质</option>
                        <option th:if="${league.level eq '社会/企业'}" th:selected="selected" value="社会/企业">社会/企业</option>
                        <option th:if="${league.level eq '大学'}" th:selected="selected" value="大学">大学</option>
                        <option th:if="${league.level eq '高中'}" th:selected="selected" value="高中">高中</option>
                        <option th:if="${league.level eq '初中'}" th:selected="selected" value="初中">初中</option>
                        <option th:if="${league.level eq '小学'}" th:selected="selected" value="小学">小学</option>
                        <option th:if="${league.level eq '幼儿园'}" th:selected="selected" value="幼儿园">幼儿园</option>
                    </select>-->
                </div>
            </div>
            <!--几人制联赛-->
            <div class="layui-form-item">
                <label class="layui-form-label">几人制联赛</label>
                <div class="layui-input-block" style="width:20%">
                    <select th:value="${league.number}" name="number" lay-verify="required">
                        <option value="">请选择几人制联赛</option>
                        <option th:selected="${league.number==3}" value="3">3</option>
                        <option th:selected="${league.number==4}" value="4">4</option>
                        <option th:selected="${league.number==5}" value="5">5</option>
                        <option th:selected="${league.number==6}" value="6">6</option>
                        <option th:selected="${league.number==7}" value="7">7</option>
                        <option th:selected="${league.number==8}" value="8">8</option>
                        <option th:selected="${league.number==9}" value="9">9</option>
                        <option th:selected="${league.number==10}" value="10">10</option>
                        <option th:selected="${league.number==11}" value="11">11</option>
                    </select>
                </div>
            </div>
            <!--半场时间-->
            <div class="layui-form-item">
                <label class="layui-form-label">半场时间</label>
                <div class="layui-input-block" style="width:20%">
                    <select th:field="${league.halfTime}" th:value="${league.halfTime}" name="halfTime" lay-verify="required">
                        <option value="">请选择半场时间</option>
                        <option th:selected="${league.halfTime=='10分钟'}" value="10分钟">10分钟</option>
                        <option th:selected="${league.halfTime=='20分钟'}" value="20分钟">20分钟</option>
                        <option th:selected="${league.halfTime=='30分钟'}" value="30分钟">30分钟</option>
                        <option th:selected="${league.halfTime=='40分钟'}" value="40分钟">40分钟</option>
                        <option th:selected="${league.halfTime=='45分钟'}" value="45分钟">45分钟</option>
                    </select>
                </div>
            </div>
            <!--中场休息时间-->
            <div class="layui-form-item">
                <label class="layui-form-label">中场休息时间</label>
                <div class="layui-input-block" style="width:20%">
                    <select th:field="${league.halfRelaxTime}" th:value="${league.halfRelaxTime}" name="halfRelaxTime" lay-verify="required">
                        <option value="">请选择中场休息时间</option>
                        <option th:selected="${league.halfRelaxTime=='10分钟'}" value="10分钟">5分钟</option>
                        <option th:selected="${league.halfRelaxTime=='20分钟'}" value="20分钟">10分钟</option>
                        <option th:selected="${league.halfRelaxTime=='30分钟'}" value="30分钟">20分钟</option>
                        <option th:selected="${league.halfRelaxTime=='40分钟'}" value="40分钟">30分钟</option>
                    </select>
                </div>
            </div>
            <!--弃权默认比分-->
            <div class="layui-form-item">
                <label class="layui-form-label">弃权默认比分</label>
                <div class="layui-input-block" style="width:20%">
                    <select th:field="${league.abstentionScore}" th:value="${league.abstentionScore}" name="abstentionScore" lay-verify="required">
                        <option value="">请选择弃权默认比分</option>
                        <option th:selected="${league.abstentionScore=='1:0(负)'}" value="1:0(负)">1:0(负)</option>
                        <option th:selected="${league.abstentionScore=='2:0(负)'}" value="2:0(负)">2:0(负)</option>
                        <option th:selected="${league.abstentionScore=='3:0(负)'}" value="3:0(负)">3:0(负)</option>
                        <option th:selected="${league.abstentionScore=='4:0(负)'}" value="4:0(负)">4:0(负)</option>
                        <option th:selected="${league.abstentionScore=='5:0(负)'}" value="5:0(负)">5:0(负)</option>
                    </select>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="*">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>

            <!--<input type="text" name="leagueName"  id="leagueName" th:value="*{leagueName}" placeholder="联赛名称"/>-->
            <!--<input type="text" name="startDate"  id="startDate" th:value="*{startDate}" placeholder="开始日期"/>-->
            <!--<input type="text" name="endDate"  id="endDate" th:value="*{endDate}" placeholder="结束日期"/>-->
            <!--<input type="submit" value="确认">-->
        </form>
    </div>
</div>

<!-- 修改密码弹窗 -->
<script type="text/html" id="pswModel1">
    <div id="pswModel" th:replace="index::changePsw">
    </div>
</script>
</body>

<script src="/plugins/layui/layui.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>

<script>
    layui.use('form', function () {
        var form = layui.form;

        //各种基于事件的操作，下面会有进一步介绍
    });

    layui.use('element', function () {
        var element = layui.element;

        //一些事件监听
        element.on('tab(demo)', function (data) {
            console.log(data);
        });
    });

    /*时间选择器*/
    layui.use('laydate', function () {
        var starttime = layui.laydate;
        var endtime = layui.laydate;
        //执行一个laydate实例
        starttime.render({
            elem: '#StartTime'
            , theme: '#1E9FFF'
        });
        endtime.render({
            elem: '#EndTime'
            , theme: '#1E9FFF'
        });
    });

    //显示个人信息
    function info() {
        layui.use(['layer'], function () {
            var layer = layui.layer;
            layer.open({
                type: 1,
                title: '个人信息',
                area: '350px',
                offset: '120px',
                content: '<ul style="padding:25px 35px 8px 35px;">' +
                '<li>用户名：[[${session.loginUser}]]</li>' +
                '<li>手机号：13657936306</li>' +
                '</ul>',
                btn: ['确定'],
                btnAlign: 'center'
            });
        });
    }

    //修改密码
    function changePassword() {
        layui.use(['layer'], function () {
            var layer = layui.layer;
            layer.open({
                type: 1,
                title: "修改密码",
                area: '400px',
                offset: '120px',
                content: $("#pswModel1").html()
            });
        })
    }
</script>
</html>